#include "../include/dir.h"

int sendtlv(int netfd, char *buf){
    tlv_t tlv;
    bzero(&tlv, sizeof(tlv_t));
    tlv.type = -1;
    tlv.value_len = strlen(buf);
    strcpy(tlv.value,buf);

    send(netfd, &tlv.type, sizeof(int), MSG_NOSIGNAL);
    send(netfd, &tlv.value_len, sizeof(int), MSG_NOSIGNAL);
    send(netfd, tlv.value, tlv.value_len, MSG_NOSIGNAL);
    return 0;
}
